import Qs from "qs";
import request from "@/utils/request";
import {
	serverip2,
	serverip1,
	serverip3
} from "./serverIP";


export const fetchData = (query) => {
	return request({
		headers: {
			// 配置请求头
			"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
		},
		// url: serverip1 + "/Sp/networkspeed",
		url: serverip1 + "/getdata.ashx",
		method: "post",
		data: query,
		transformRequest: [
			function(data) {
				// 对请求数据进行 form-data 格式化
				data = Qs.stringify(data);
				return data;
			},
		],
	});
};

export const getData = (url, query) => {
	return request({
		headers: {
			// 配置请求头
			"Content-Type": "application/x-www-form-urlencoded",
		},
		url: serverip2 + url,
		method: "post",
		data: query,
		transformRequest: [
			function(data) {
				// 对请求数据进行 form-data 格式化
				data = Qs.stringify(data);
				return data;
			},
		],
	});
};

export const fetchData2 = (query) => {
	return request({
		headers: {
			// 配置请求头
			"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
		},
		url: serverip2 + "/Sp/networkspeed",
		// url: serverip1 + "/getdata.ashx",
		method: "post",
		data: query,
		transformRequest: [
			function(data) {
				// 对请求数据进行 form-data 格式化
				data = Qs.stringify(data);
				return data;
			},
		],
	});
};

export const addNode = (query) => {
	return request({
			headers: {	
			// 配置请求头
			"Content-Type": "application/json",
		},
		url: serverip2 + "/Sp/addPerformance_analysis",
		method: "post",
		data: query,
	});
};

export const addServer = (query) => {
	return request({
			headers: {	
			// 配置请求头
			"Content-Type": "application/json",
		},
		url: serverip2 + "/Sp/upPerformance_analysis",
		method: "post",
		data: query,
	});
};

export const getServerData = (query) => {
	return request({
			headers: {	
			// 配置请求头
			"Content-Type": "application/json",
		},
		url: serverip2 + "/Sp/selePerformance_analysis",
		method: "post",
		data: query,
	});
};

export const editNode = (query) => {
	return request({
			headers: {	
			// 配置请求头
			"Content-Type": "application/json",
		},
		url: serverip2 + "/Sp/upPerformance_analysis",
		method: "post",
		data: query,
	});
};

export const deleteNode = (query) => {
	return request({
			headers: {	
			// 配置请求头
			"Content-Type": "application/json",
		},
		url: serverip2 + "/Sp/delePerformance_analysis",
		method: "post",
		data: query,
	});
};

export const deleteServer = (query) => {
	return request({
			headers: {	
			// 配置请求头
			"Content-Type": "application/json",
		},
		url: serverip2 + "/Sp/delenode",
		method: "post",
		data: query,
	});
};

// export const addNode = (query) => {
//   return request({
//     url: serverip2 + "/Sp/addPerformance_analysis",
//     method: "post",
//     params: query,
//   });
// };

export const nodeAllData = (query) => {
	return request({
		headers: {
			// 配置请求头
			"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
		},
		url: serverip2 + "/Sp/seleallPerformance_analysis",
		method: "post",
		data: query,
		transformRequest: [
			function(data) {
				// 对请求数据进行 form-data 格式化
				data = Qs.stringify(data);
				return data;
			},
		],
	});
};

// export const submitData = (query) => {
//     return request({
//         url: '/DataHandler.ashx',
//         method: 'post',
//         data: query
//     })
// }

export const submitLogin = (query) => {
	return request({
		headers: {
			// 配置请求头
			"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
		},
		url: serverip1 + "/login.ashx",
		method: "post",
		data: query,
		transformRequest: [
			function(data) {
				// 对请求数据进行 form-data 格式化
				data = Qs.stringify(data);
				return data;
			},
		],
	});
};

export const submitAdmin = (query) => {
	return request({
		headers: {
			// 配置请求头
			"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
		},
		url: serverip1 + "/admin.ashx",
		method: "post",
		data: query,
		transformRequest: [
			function(data) {
				// 对请求数据进行 form-data 格式化
				data = Qs.stringify(data);
				return data;
			},
		],
	});
};

export const exportData = (url, data) => {
	return request({
		// baseURL: '/api2',
		// headers: {
		//     'Content-Type': 'application/json'
		// },
		url: serverip2 + url,
		method: "post",
		data: data,
		responseType: "blob",
	});
};

// development
export const devFetchData = (query) => {
	return request({
		url: "./option.json",
		method: "get",
		params: query,
	});
};

export const getEchartData = () => {
	return request({
		url: "http://172.20.1.49:8099/api/EchartData",
		method: "get",
	});
};

//由于浏览器同源 临时使用
export const EchartDevFetchData = () => {
	return request({
		// baseURL: '/api2',
		url: serverip2 + "/Sp/selectbysystem",
		// url: '/Sp/selectbysystem',
		method: "get",
		// params: query
	});
};

export const selectServerCpu = (query) => {
	return request({
		headers: {
			"Content-Type": "application/json",
		},
		url: serverip2 + "/Sp/selectcpu",
		method: "get",
		params: query,
	});
};

export const getHisoryDataForMemory = (query) => {
	return request({
		url: serverip2 + "/Sp/selectmemory",
		method: "get",
		params: query,
	});
};
export const getFileMounted = (query) => {
	return request({
		url: serverip2 + "/Sp/selectholdon",
		method: "get",
		params: query,
	});
};
export const getFileSystemHistory = (query) => {
	return request({
		url: serverip2 + "/Sp/selectfile",
		method: "get",
		params: query,
	});
};

export const getReportBase = () => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/seledbbytime",
		method: "get",
		// params: data
	});
};

export const searchReportBase = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/seledbbyip",
		method: "post",
		data: data,
	});
};

export const InternetDelete = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/seledbbyip",
		method: "post",
		data: data,
	});
};

export const InternetEdit = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/seledbbyip",
		method: "post",
		data: data,
	});
};

export const InternetAdd = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/seledbbyip",
		method: "post",
		data: data,
	});
};

export const Testseledb = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/seledb",
		method: "get",
		// data: data
	});
};

// baseInfo

export const baseInfo = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/spacebaseinfo",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// TableSpaceInfo

export const TableSpaceInfo = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/tablespaceuse",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};
// TableSpacePieInfo
export const TableSpacePieInfo = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Defragment",
		// method:'post',
		// data:data,
		method: "post",
		params: data,
	});
};
// BasePerInfo
export const BasePerInfo = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/dbtime",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// BaseLog
export const BaseLog = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/syslog",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// mail

export const mail = (data) => {
	return request({
		// baseURL: 'api3',
		url: "http://172.20.1.155:9003/api/sendEmail",
		// method:'post',
		// data:data,
		method: "post",
		params: data,
	});
};

// wechat
export const wechat = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/alarm/editQywxConfig",
		// method:'post',
		// data:data,
		method: "post",
		params: data,
	});
};

//selecthost
export const selecthost = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/selecthost",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

//selectosinfo

export const selectosinfo = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/selectosinfo",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

//selectoscpu

export const selectoscpu = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/selectoscpu",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

//selectosmemory

export const selectosmemory = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/selectosmemory",
		// method:'post',
		// data:data,
		method: "post",
		params: data,
	});
};

//selectosfile

export const selectosfile = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/selectosfile",
		// method:'post',
		// data:data,
		method: "post",
		params: data,
	});
};

//softInfo,
export const softInfo = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/softinfo",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};
//	hardInfo,
export const hardInfo = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/hardinfo",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};
//	tableSpaceUse,
export const tableSpaceUse = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/tablespaceuse",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};
//	syslog,
export const syslog = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/syslog",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// controlFile,
export const controlFile = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/controlfile",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};
// Tigger,
export const Tigger = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/trigger",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};
// DBhit,
export const DBhit = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/DBhit",
		// method:'post',
		params: data,
		method: "get",
	});
};
// tableSall
export const tableSall = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/tablesall",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

export const tableSall1 = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/orasessionselect",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// Parameter

export const Parameter = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/Parameter",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};
// BaseEvent
export const BaseEvent = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/event",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};
// Generalsituation
export const Generalsituation = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/Generalsituation",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// Login
export const Login = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/login",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// getinfo
export const getinfo = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/selectuser",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// addUser
export const addUser = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/adduser",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// editUser
export const editUser = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/updateuser",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// deleceUser
export const deleceUser = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/deleuser",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

//todayosinfo

export const todayosinfo = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/OSinfo",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

//todayostext

export const todayostext = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/OStext",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// todayDbinfo

export const todayDbinfo = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/DBinfo",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// DBusing
export const DBusing = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/DBusing",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// DBtablespace
export const DBtablespace = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/DBtablespace",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// DBsyslog
export const DBsyslog = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/DBsyslog",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

//DBASM

export const DBASM = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/DBASM",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// DBOGG
export const DBOGG = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/DBOGG",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// DBADG
export const DBADG = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/DBADG",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// DBbackups
export const DBbackups = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/DBbackups",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// DBhhit
export const DBhhit = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/DBhhit",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

// DBtopevent
export const DBtopevent = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/DBtopevent",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

//Archived
export const Archived = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/aa",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

export const getSqlServerItem = () => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/sqlserver",
		// method:'post',
		// data:data,
		method: "get",
		// params:data
	});
};

export const getSqlServerItemInfo = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/sqlserverbaseinfoselect",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

export const SqlTableSize = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/sqlservertablesizeselect",
		// method:'post',
		// data:data,
		method: "get",
		params: data,
	});
};

export const SqlIoreadWrite = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/sqlserverioselect",
		method: "get",
		params: data,
	});
};

export const GetSqlLogSize = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/sqlserverlogsizeselect",
		method: "get",
		params: data,
	});
};

export const GetSqlErrorLog = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/sqlservererrorlog",
		method: "get",
		params: data,
	});
};

export const SqlLinkType = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/linktext",
		method: "get",
		params: data,
	});
};

export const getSqlCheckSpace = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/sqlservercheckspaceselect",
		method: "get",
		params: data,
	});
};

export const getSqlLogical = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/sqlserverlogical_readsselect",
		method: "get",
		params: data,
	});
};

export const getSqlPhysical = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/sqlserverphysicalreadsselect",
		method: "get",
		params: data,
	});
};

export const getTodayDBItem = () => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/DBip",
		method: "get",
		// params:data
	});
};

export const putTodayDBItem = (data) => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/DB",
		method: "get",
		params: data,
	});
};

export const getSqlLinkTest = () => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/sqlhomepage",
		method: "get",
		// params:data
	});
};
export const getMySqlLinkTest = () => {
	return request({
		// baseURL: 'api2',
		url: serverip2 + "/Sp/mysqlhomepage",
		method: "get",
		// params:data
	});
};

export const getMysqlItem = () => {
	return request({
		url: serverip2 + "/Sp/mysql",
		method: "get",
	});
};

export const getMysqlInfo = (data) => {
	return request({
		url: serverip2 + "/Sp/mysqlbaseinfoselect",
		method: "get",
		params: data,
	});
};

export const getMysqlConnectInfo = (data) => {
	return request({
		url: serverip2 + "/Sp/mysqlconnectselect",
		method: "get",
		params: data,
	});
};

export const getMysqlConnectInfoTwo = (data) => {
	return request({
		url: serverip2 + "/Sp/mysqlbaseinfoselect",
		method: "get",
		params: data,
	});
};

export const MySqlTableSize = (data) => {
	return request({
		url: serverip2 + "/Sp/mysqltablesizeselect",
		method: "get",
		params: data,
	});
};

export const MySqlIoreadWrite = (data) => {
	return request({
		url: serverip2 + "/Sp/mysqlioselect",
		method: "get",
		params: data,
	});
};

export const getMysqlHit = (data) => {
	return request({
		url: serverip2 + "/Sp/mysqlhitselect",
		method: "get",
		params: data,
	});
};

export const getMysqlErrLog = (data) => {
	return request({
		url: serverip2 + "/Sp/MYSQL_DB_logerro",
		method: "get",
		params: data,
	});
};

export const getThreadconnect = (data) => {
	return request({
		url: serverip2 + "/Sp/mysqlthreadselect",
		method: "get",
		params: data,
	});
};

export const getSqlserverIoDetail = () => {
	return request({
		url: serverip2 + "/Sp/sqlserverioall",
		method: "get",
		// params:data
	});
};

export const getSqlserverTableSize = () => {
	return request({
		url: serverip2 + "/Sp/sqlservertablesizeall",
		method: "get",
		// params:data
	});
};

export const getSqlserverLogSize = () => {
	return request({
		url: serverip2 + "/Sp/sqlserverlogsizeall",
		method: "get",
		// params:data
	});
};

export const getMysqlThread = () => {
	return request({
		url: serverip2 + "/Sp/mysqlthreadall",
		method: "get",
		// params:data
	});
};

export const getMysqlIoInfo = () => {
	return request({
		url: serverip2 + "/Sp/mysqlioall",
		method: "get",
		// params:data
	});
};

export const getMysqlTableSize = () => {
	return request({
		url: serverip2 + "/Sp/mysqltablesizeall",
		method: "get",
		// params:data
	});
};

export const getMysqlhitall = () => {
	return request({
		url: serverip2 + "/Sp/mysqlhitall",
		method: "get",
		// params:data
	});
};
export const MySqlLinkType = (data) => {
	return request({
		url: serverip2 + "/Sp/mysqllinktext",
		method: "get",
		params: data,
	});
};

export const TryLinkDataBase = (data) => {
	return request({
		url: serverip2 + "/Sp/dbable",
		method: "get",
		params: data,
	});
};

export const getOracleLinkTest = () => {
	return request({
		url: serverip2 + "/Sp/oraclehomepage",
		method: "get",
		// params:data
	});
};

export const getManagementNodeOs = (data) => {
	return request({
		url: serverip2 + "/Sp/host",
		method: "get",
		params: data,
	});
};

export const getAlertDB = (data) => {
	return request({
		url: serverip2 + "/Sp/alertdb",
		method: "get",
		params: data,
	});
};
export const getAlertOSNetwork = (data) => {
	return request({
		url: serverip2 + "/Sp/alertosnetwork",
		method: "get",
		params: data,
	});
};

export const getFaultStatistics = () => {
	return request({
		url: serverip2 + "/Sp/alertlistall",
		method: "get",
		// params:data
	});
};

export const getRealTime = (data) => {
	return request({
		url: serverip2 + "/Sp/ranking",
		method: "get",
		params: data,
	});
};

export const getBusinessHealth = (data) => {
	return request({
		url: serverip2 + "/Sp/businesshealth",
		method: "get",
		params: data,
	});
};

export const getHistoryWarning = (data) => {
	return request({
		url: serverip2 + "/Sp/hisalert",
		method: "get",
		params: data,
	});
};

export const getTodayExamineDBinfo = () => {
	return request({
		url: serverip2 + "/Sp/DBip",
		method: "get",
	});
};

export const getTodayExamineServerinfo = () => {
	return request({
		url: serverip2 + "/Sp/oncehost",
		method: "get",
	});
};

//TED

export const getTEDBackup = (data) => {
	return request({
		url: serverip2 + "/Sp/backup",
		method: "get",
		params: data,
	});
};

export const getTEDASM = (data) => {
	return request({
		url: serverip2 + "/Sp/Asmuse",
		method: "get",
		params: data,
	});
};

export const getTEDTableSpace = (data) => {
	return request({
		url: serverip2 + "/Sp/tablespace",
		method: "get",
		params: data,
	});
};

export const getTEDRecyclebin = (data) => {
	return request({
		url: serverip2 + "/Sp/recyclebin",
		method: "get",
		params: data,
	});
};

export const getTEDInvalidObject = (data) => {
	return request({
		url: serverip2 + "/Sp/INVALIDOBJECT",
		method: "get",
		params: data,
	});
};

export const getTEDDBAUser = (data) => {
	return request({
		url: serverip2 + "/Sp/dbauser",
		method: "get",
		params: data,
	});
};

export const getTEDDBTime = (data) => {
	return request({
		url: serverip2 + "/Sp/dbtime",
		method: "get",
		params: data,
	});
};

export const getTEDWaitClass = (data) => {
	return request({
		url: serverip2 + "/Sp/waitclass",
		method: "get",
		params: data,
	});
};

export const getTEDLock = (data) => {
	return request({
		url: serverip2 + "/Sp/lock",
		method: "get",
		params: data,
	});
};

export const getTEDInformation = (data) => {
	return request({
		url: serverip2 + "/Sp/informationget",
		method: "get",
		params: data,
	});
};

export const getTEDLatch = (data) => {
	return request({
		url: serverip2 + "/Sp/Latch",
		method: "get",
		params: data,
	});
};

//原分项监控 的 基础信息
export const getItemMonitorDbinfo = (data) => {
	return request({
		url: serverip2 + "/Sp/detailsbaseinfo",
		method: "get",
		params: data,
	});
};

//原分项监控 的 SQL语句
export const getItemMonitorSQLinfo = (data) => {
	return request({
		url: serverip2 + "/Sp/oraclesql",
		method: "get",
		params: data,
	});
};
//原分项监控 的 Dbtime
export const getItemMonitorDbTime = (data) => {
	return request({
		url: serverip2 + "/Sp/detailsdetime",
		method: "get",
		params: data,
	});
};

//原分项监控 的 等待事件
export const getItemMonitorDbWaitEvent = (data) => {
	return request({
		url: serverip2 + "/Sp/detailstopwaits",
		method: "get",
		params: data,
	});
};
//原分项监控 的 会话信息
export const getItemMonitorSessionInformation = (data) => {
	return request({
		url: serverip2 + "/Sp/orasession",
		method: "get",
		params: data,
	});
};
//原分项监控 的 内存使用情况
export const getItemMonitorDbMemory = (data) => {
	return request({
		url: serverip2 + "/Sp/detailsio",
		method: "get",
		params: data,
	});
};

//原分项监控 的 无效对象
export const getItemMonitorDbInvalidObject = (data) => {
	return request({
		url: serverip2 + "/Sp/detailsdeinvalid",
		method: "get",
		params: data,
	});
};

export const getDBbeifen = (data) => {
	return request({
		url: serverip2 + "/Sp/detailsbackup",
		method: "get",
		params: data,
	});
};


//原分项监控 的 告警日志

export const getItemMonitorWarningLog = (data) => {
	return request({
		url: serverip2 + "/Sp/daily",
		method: "get",
		params: data,
	});
};

export const getHostProcess = (data) => {
	return request({
		url: serverip2 + "/Sp/hostprocess",
		method: "get",
		params: data,
	});
};

export const getWarnningPanelSSGJ = (data) => {
	return request({
		url: serverip2 + "/Sp/alertdbos",
		method: "get",
		params: data,
	});
};

export const getNodeUsability = (data) => {
	return request({
		url: serverip2 + "/Sp/homeable",
		method: "get",
		params: data,
	});
};

export const getTEDDiary = (data) => {
	return request({
		url: serverip2 + "/Sp/daily",
		method: "get",
		params: data,
	});
};

export const getTEDDBInfo = (data) => {
	return request({
		url: serverip2 + "/Sp/baseinfo",
		method: "get",
		params: data,
	});
};

export const getTEDDBServerInfo = (data) => {
	return request({
		url: serverip2 + "/Sp/osinfo",
		method: "get",
		params: data,
	});
};

export const getTEDDBMEMORY = (data) => {
	return request({
		url: serverip2 + "/Sp/memory",
		method: "get",
		params: data,
	});
};

export const getTEDDBSGA = (data) => {
	return request({
		url: serverip2 + "/Sp/SGA",
		method: "get",
		params: data,
	});
};

export const getTEDDBPGA = (data) => {
	return request({
		url: serverip2 + "/Sp/PGA",
		method: "get",
		params: data,
	});
};

export const getTEDDBSHAREDPOOL = (data) => {
	return request({
		url: serverip2 + "/Sp/SHAREDPOOL",
		method: "get",
		params: data,
	});
};

export const getTEDDBDBCACHE = (data) => {
	return request({
		url: serverip2 + "/Sp/DBCACHE",
		method: "get",
		params: data,
	});
};

export const getOsLinkTest = () => {
	return request({
		url: serverip2 + "/Sp/oshomepage",
		method: "get",
	});
};

export const getServerLoad = (data) => {
	return request({
		url: serverip2 + "/Sp/osresources",
		method: "get",
		params: data,
	});
};

export const DetermineTheAlarm = (data) => {
	return request({
		url: serverip2 + "/Sp/Solvedalertlist",
		method: "get",
		params: data,
	});
};

export const getBusinessNode = (data) => {
	return request({
		url: serverip2 + "/Sp/busystem",
		method: "get",
		params: data,
	});
};

export const putWhetherToAlert = (data) => {
	return request({
		url: serverip2 + "/Sp/Alarmpush",
		method: "get",
		params: data,
	});
};

export const phone = (data) => {
	return request({
		url: serverip2 + "/Sp/Alarmpush",
		method: "get",
		params: data,
	});
};

export const pushPhone = (data) => {
	return request({
		url: serverip2 + "/Sp/addphone",
		method: "get",
		params: data,
	});
};
export const delecePhone = (data) => {
	return request({
		url: serverip2 + "/Sp/delphone",
		method: "get",
		params: data,
	});
};
export const getPhone = () => {
	return request({
		url: serverip2 + "/Sp/showphone",
		method: "get",
	});
};

export const editPhone = (data) => {
	return request({
		url: serverip2 + "/Sp/changephone",
		method: "get",
		params: data,
	});
};
export const getHistoryDataServerUsage = (data) => {
	return request({
		url: serverip2 + "/Sp/osdetail",
		method: "get",
		params: data,
	});
};

export const getBusinessServicesname = () => {
	return request({
		url: serverip2 + "/Sp/bidchangee",
		method: "get",
		// params:data
	});
};

export const getSwapSpace = (data) => {
	return request({
		url: serverip2 + "/Sp/linuxExchangespaceselect",
		method: "get",
		params: data,
	});
};

export const getWarningFault = (data) => {
	return request({
		url: serverip2 + "/Sp/alertselct",
		method: "get",
		params: data,
	});
};

export const getActionLog = (data) => {
	return request({
		url: serverip2 + "/Sp/showlog",
		method: "get",
		params: data,
	});
};

export const putActionLog = (data) => {
	return request({
		url: serverip2 + "/Sp/Operationlog",
		method: "get",
		params: data,
	});
};

export const getMysqlInnoDBStatus = (data) => {
	return request({
		url: serverip2 + "/Sp/MYSQL_innodbstatus",
		method: "get",
		params: data,
	});
};

export const getMysqlRedundancyIndex = (data) => {
	return request({
		url: serverip2 + "/Sp/MYSQL_index",
		method: "get",
		params: data,
	});
};

export const getMysqlStorageEngine = (data) => {
	return request({
		url: serverip2 + "/Sp/MYSQL_Engine",
		method: "get",
		params: data,
	});
};

export const getManagementLabelOptions = () => {
	return request({
		url: serverip2 + "/Sp/lableselect",
		method: "get",
	});
};

export const getNetworktopology = () => {
	return request({
		url: serverip2 + "/Sp/Networktopology",
		method: "get",
	});
};

export const getSqlserversqlserverbackup = () => {
	return request({
		url: serverip2 + "/Sp/sqlserverbackupselect",
		method: "get",
	});
};

export const getsqlserverbackupselectdetail = (data) => {
	return request({
		url: serverip2 + "/Sp/sqlserverbackupselectdetail",
		method: "get",
		params: data,
	});
};

export const getPARENTLABLEPORT = (data) => {
	return request({
		url: serverip2 + "/Sp/parentlableportselect",
		method: "get",
		params: data,
	});
};

// 2022 0217 封装请求 前面不管了
// api string 请求地址

/**
 * get请求方式无参
 *
 * @param {*} api 后台接口，例：/api/**
 * @return {*} Promise
 */
export const getJavaServerNotData = (api) => {
	return request({
		url: serverip2 + api,
		method: "get",
	});
};

/**
 * get请求方式有参
 *
 * @param {*} api 后台接口，例：/api/**
 * @param {*} data 传过去的数据
 * @return {*} Promise
 */
export const getJavaServerData = (api, data) => {
	return request({
		url: serverip2 + api,
		method: "get",
		params: data,
	});
};

/**
 * post请求方式
 *
 * @param {*} api 后台接口，例：/api/**
 * @param {*} data 传过去的数据
 * @return {*} Promise
 */
export const postJavaServerData = (api, data) => {
	return request({
		url: serverip2 + api,
		method: "post",
		data: JSON.stringify(data),
	});
};
